package com.xveshe.admin.service.impl;

import java.util.List;
import java.util.UUID;

import com.xveshe.common.utils.DateUtils;
import com.xveshe.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xveshe.admin.mapper.XsglGxhGjgsMapper;
import com.xveshe.admin.domain.XsglGxhGjgs;
import com.xveshe.admin.service.IXsglGxhGjgsService;

/**
 * 岗级岗时个性化设置Service业务层处理
 *
 * @author geyasong
 * @date 2024-11-05
 */
@Service
public class XsglGxhGjgsServiceImpl implements IXsglGxhGjgsService
{
    @Autowired
    private XsglGxhGjgsMapper xsglGxhGjgsMapper;

    /**
     * 查询岗级岗时个性化设置
     *
     * @param id 岗级岗时个性化设置主键
     * @return 岗级岗时个性化设置
     */
    @Override
    public XsglGxhGjgs selectXsglGxhGjgsById(String id)
    {
        return xsglGxhGjgsMapper.selectXsglGxhGjgsById(id);
    }

    /**
     * 查询岗级岗时个性化设置列表
     *
     * @param xsglGxhGjgs 岗级岗时个性化设置
     * @return 岗级岗时个性化设置
     */
    @Override
    public List<XsglGxhGjgs> selectXsglGxhGjgsList(XsglGxhGjgs xsglGxhGjgs)
    {
        return xsglGxhGjgsMapper.selectXsglGxhGjgsList(xsglGxhGjgs);
    }

    /**
     * 新增岗级岗时个性化设置
     *
     * @param xsglGxhGjgs 岗级岗时个性化设置
     * @return 结果
     */
    @Override
    public int insertXsglGxhGjgs(XsglGxhGjgs xsglGxhGjgs)
    {
        xsglGxhGjgs.setId(UUID.randomUUID().toString());
        //获取用户账号xsglXslb.setCreator(SecurityUtils.getUsername());
        //获取用户昵称
        xsglGxhGjgs.setCreator(SecurityUtils.getLoginUser().getUser().getNickName());
        xsglGxhGjgs.setCreatedate(DateUtils.getNowDate());
        return xsglGxhGjgsMapper.insertXsglGxhGjgs(xsglGxhGjgs);
    }

    /**
     * 修改岗级岗时个性化设置
     *
     * @param xsglGxhGjgs 岗级岗时个性化设置
     * @return 结果
     */
    @Override
    public int updateXsglGxhGjgs(XsglGxhGjgs xsglGxhGjgs)
    {
        xsglGxhGjgs.setLastmodifier(SecurityUtils.getLoginUser().getUser().getNickName());
        xsglGxhGjgs.setLastmodifieddate(DateUtils.getNowDate());
        return xsglGxhGjgsMapper.updateXsglGxhGjgs(xsglGxhGjgs);
    }

    /**
     * 批量删除岗级岗时个性化设置
     *
     * @param ids 需要删除的岗级岗时个性化设置主键
     * @return 结果
     */
    @Override
    public int deleteXsglGxhGjgsByIds(String[] ids)
    {
        return xsglGxhGjgsMapper.deleteXsglGxhGjgsByIds(ids);
    }

    /**
     * 删除岗级岗时个性化设置信息
     *
     * @param id 岗级岗时个性化设置主键
     * @return 结果
     */
    @Override
    public int deleteXsglGxhGjgsById(String id)
    {
        return xsglGxhGjgsMapper.deleteXsglGxhGjgsById(id);
    }
}
